package com.taxsystem.yehao.tool;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.Map;
import java.util.concurrent.ExecutionException;

import org.apache.http.ParseException;
import org.json.JSONException;
import org.json.JSONObject;

public class UrlPost {
	public static JSONObject getJsonObject(String url, Map<String,Object> param)
			throws ParseException, IOException, JSONException, InterruptedException, ExecutionException {
		if(param.size()!=0)url=url+"?";
		for (String key : param.keySet()) {
		    String value = param.get(key).toString();
		    url=url+"&"+key+"="+value;
		}
		String json = HttUtil.getRequest(url);
		JSONObject jsonObject = new JSONObject(json);
		return jsonObject;
	} 
}
